@echo off
setlocal enabledelayedexpansion

:install_jar
set file=%~1
set artifactId=%~2

echo Installing %file%...
mvn install:install-file ^
    -Dfile=%file% ^
    -DgroupId=cn.bluetron.supos ^
    -DartifactId=%artifactId% ^
    -Dversion=1.0.1 ^
    -Dpackaging=jar
if %errorlevel% neq 0 (
    echo Failed to install %file%
    exit /b 1
)
echo Successfully installed %file%

goto :eof

call :install_jar "openapi-httpclient-core.jar" "openapi-httpclient-core"
call :install_jar "openapi-httpclient-httpclient5.jar" "openapi-httpclient-httpclient5"
call :install_jar "openapi-httpclient-boot-starter.jar" "openapi-httpclient-boot-starter"

endlocal